/*     */ package btsm.servlet;
/*     */ 
/*     */ import btsm.bean.sqlBTSWork;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintStream;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServlet;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class ser_tran extends HttpServlet
/*     */ {
/*     */   public void init()
/*     */     throws ServletException
/*     */   {
/*     */   }
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  20 */     sqlBTSWork PC = new sqlBTSWork("transformer", "1");
/*  21 */     String[] addfieldxg = new String[10];
/*     */ 
/*  23 */     String seraction = request.getParameter("seraction");
/*  24 */     String strbtscode = request.getParameter("btscode");
/*  25 */     String strbtsname = request.getParameter("btsname");
/*  26 */     String strsnid = request.getParameter("snid");
/*  27 */     String strToPage = request.getParameter("ToPage");
/*  28 */     addfieldxg[0] = request.getParameter("tranPowerType");
/*  29 */     addfieldxg[1] = request.getParameter("tranMaintain");
/*  30 */     addfieldxg[2] = request.getParameter("tranHighLen");
/*  31 */     addfieldxg[3] = request.getParameter("tranLowLen");
/*  32 */     addfieldxg[4] = request.getParameter("tranRValue");
/*  33 */     addfieldxg[5] = request.getParameter("tranStartTime");
/*     */ 
/*  36 */     if (strToPage == null) {
/*  37 */       strToPage = request.getParameter("tToPage");
/*     */     }
/*     */ 
/*  40 */     System.out.println("传输serBF：btsname:" + strbtsname);
/*  41 */     strbtsname = new String(strbtsname.getBytes("ISO8859-1"), "UTF-8");
/*  42 */     System.out.println("传输serEF中：btsname:" + strbtsname);
/*  43 */     System.out.println("strTranPowerType:" + addfieldxg[0]);
/*  44 */     System.out.println("strTranMaintain:" + addfieldxg[1]);
/*  45 */     System.out.println("strTranHighLen:" + addfieldxg[2]);
/*  46 */     System.out.println("strTranLowLen:" + addfieldxg[3]);
/*  47 */     System.out.println("strTranRValue:" + addfieldxg[4]);
/*  48 */     System.out.println("strTranStartTime:" + addfieldxg[5]);
/*     */ 
/*  51 */     request.setAttribute("btscode", strbtscode);
/*  52 */     request.setAttribute("btsname", strbtsname);
/*     */ 
/*  54 */     String filesnames = request.getParameter("filesnames");
/*     */ 
/*  56 */     String msg = "";
/*  57 */     String strRedURL = "common.jsp";
/*     */ 
/*  60 */     if (seraction.equalsIgnoreCase("serinsertsimple"))
/*     */     {
/*  62 */       if (PC.insertsimple(strbtscode, strbtsname))
/*  63 */         msg = "新建变压器成功";
/*     */       else
/*  65 */         msg = "新建变压器失败";
/*     */     }
/*  67 */     else if (seraction.equalsIgnoreCase("sermodp"))
/*     */     {
/*  69 */       request.setAttribute("snid", strsnid);
/*  70 */       if (strToPage == null)
/*  71 */         strToPage = "1";
/*  72 */       strRedURL = "nnmd_tran.jsp?ToPage=" + strToPage + "&btsname=" + strbtsname;
/*  73 */     } else if (seraction.equals("serdel")) {
/*  74 */       if (PC.delbyid(strsnid))
/*  75 */         msg = "变压器信息删除成功";
/*     */       else {
/*  77 */         msg = "变压器删除失败";
/*     */       }
/*  79 */       strsnid = "";
/*  80 */     } else if (seraction.equals("sermod")) {
/*  81 */       String[] fieldxg = request.getParameterValues("T1");
/*     */ 
/*  84 */       if (PC.mdByID(fieldxg, strsnid)) {
/*  85 */         PC.mdAddByID(addfieldxg, strsnid, "tran");
/*  86 */         msg = "变压器信息修改成功";
/*     */       } else {
/*  88 */         msg = "变压器修改失败";
/*     */       }
/*     */     }
/*  91 */     PC.dbConClose();
/*  92 */     String filesnamesmd = "ser_tran?seraction=sermodp&btscode=" + strbtscode + "&btsname=" + strbtsname + "&filesnames=" + filesnames + "&snid=" + strsnid + "&ToPage=" + strToPage;
/*  93 */     request.setAttribute("filesnames", filesnamesmd);
/*  94 */     request.setAttribute("msg", msg);
/*  95 */     RequestDispatcher btsm = request.getRequestDispatcher(strRedURL);
/*  96 */     btsm.forward(request, response);
/*     */   }
/*     */ 
/*     */   public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
/*     */   {
/* 101 */     doGet(request, response);
/*     */   }
/*     */ 
/*     */   public void destroy()
/*     */   {
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     btsm.servlet.ser_tran
 * JD-Core Version:    0.6.2
 */